package shili;

import java.util.concurrent.*;

public class threadPoolExecutor {
    public static void main(String[] args) {
        ExecutorService pool = new ThreadPoolExecutor(5,10,1000,
                TimeUnit.MILLISECONDS,new ArrayBlockingQueue<>(100), Executors.defaultThreadFactory(),
                new ThreadPoolExecutor.DiscardPolicy());
        for (int i = 0; i < 5; i++) {
            pool.submit(()->{
                System.out.println("hello");
            });
        }
    }
}
